Skip to content

Fix transparent background images to be displayed correctly #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

ElwynVdb
Copy link
Owner

Description

When inserting an image with an alpha channel and a transparent background into the Word document, the background was filled with white.

image

After the fix, the transparency is retained.

image

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

ElwynVdb and others added 23 commits July 30, 2024 08:41
…#2642)

* Extend the Options section of the PDF Writer documentation

When I used PHPWord to write a PDF document, recently, I followed the
docs only to find that I also had to specify a PDF renderer — otherwise
the operation failed.

After a bit of research to figure out what to do to specify one, I
thought it only right to document what I learned in the official
documentation.

* Update the docs changelog detailing the PDF Writer additions

This change updates the changelog to include the enhancement made to the
PDF Writer docs that show how to specify a PDF renderer when working
with the PDF writer.

* Fixed docs

---------

Co-authored-by: Progi1984 <progi1984@gmail.com>
Fix PHPOffice#2548. A particularly perplexing problem accidentally introduced by PR PHPOffice#2475. Problem does not arise for Php8, and does not arise for Php7 unit tests. But, running *not* under Phpunit auspices with Php7 can cause a warning message at destructor time if the `save` function has been used. A very artificial test is introduced to test this situation.
* Generate Table Cell if Row Doesn't Have Any

Fix PHPOffice#2505. Word treats file as corrupt if a table row does not contain a cell (documentation for why this is so is included in the issue). Person reporting the issue suggests that dropping such a row from the output file is preferred. However, I think generating an empty cell instead is closer to the user's expectation. For example, as demonstrated in the unit tests added with this PR, if a table has row 1 and 3 which contain cells, but row 2 does not, the table as written to the file will have 3 rows, with the second containing an empty cell.

* Remove Commented-Out Code in Tests
…ce#2618)

* Fix hardcoded macro chars

* Update changelog

---------

Co-authored-by: glafarge <glafarge@users.noreply.github.com>
…Office#2626)

* Prevented fatal errors when opening corrupt files or "doc" files

* Ran php-cs-fixer

* Fixed phpstan errors

* Updated the change log
* Bump tecnickcom/tcpdf from 6.6.5 to 6.7.5

Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.6.5 to 6.7.5.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](https://github.com/tecnickcom/TCPDF/commits/6.7.5)

---
updated-dependencies:
- dependency-name: tecnickcom/tcpdf
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updated changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Progi1984 <progi1984@gmail.com>
Fix error on comments code snippet.

Co-authored-by: laminga <39699385+laminga@users.noreply.github.com>
* Bump mpdf/mpdf from 8.2.2 to 8.2.4

Bumps [mpdf/mpdf](https://github.com/mpdf/mpdf) from 8.2.2 to 8.2.4.
- [Release notes](https://github.com/mpdf/mpdf/releases)
- [Changelog](https://github.com/mpdf/mpdf/blob/development/CHANGELOG.md)
- [Commits](mpdf/mpdf@v8.2.2...v8.2.4)

---
updated-dependencies:
- dependency-name: mpdf/mpdf
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updated changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Progi1984 <progi1984@gmail.com>
* Bump phenx/php-svg-lib from 0.5.1 to 0.5.4

Bumps [phenx/php-svg-lib](https://github.com/dompdf/php-svg-lib) from 0.5.1 to 0.5.4.
- [Release notes](https://github.com/dompdf/php-svg-lib/releases)
- [Commits](dompdf/php-svg-lib@0.5.1...0.5.4)

---
updated-dependencies:
- dependency-name: phenx/php-svg-lib
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updated changelog

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Progi1984 <progi1984@gmail.com>
Co-authored-by: damienfa <damien.fa@gmail.com>
* Bump phpstan/phpstan-phpunit from 1.3.15 to 1.4.0

Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.15 to 1.4.0.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](phpstan/phpstan-phpunit@1.3.15...1.4.0)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updated changelog

* Fixed PHPStan errors

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Progi1984 <progi1984@gmail.com>
* added support for REF field

* Spelling correction

* UnitTest and fixes

* updated documentation

* Update doc docs/elements.rst. Aded ref support

* Rebase & Fixed CI

---------

Co-authored-by: Adekunle <crystoline@gmail.com>
Co-authored-by: Adekunle Adekoya <adekunle.adekoya@upperlink.ng>
* Added code to read FormFields (text input, dropdown and checkbox) from a Word file

* Fixed code style issues and added a testcase for reading a FormField of type checkbox

* Fixed minor issue found by Scrutinizer

* Fixed CI

---------

Co-authored-by: Vincent Kool <vincentkool@gmail.com>
…ice#2635)

* Fix first footnote appearing as separator

* Add test

* Update changelog

* Fixed changelog

---------

Co-authored-by: Progi1984 <progi1984@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants